package cn.cdeden.knowledge.domain;

import cn.cdeden.knowledge.domain.dto.TeamRoleDto;
import cn.cdeden.knowledge.domain.dto.TeamTemplateTreeDto;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
//import io.swagger.annotations.ApiModelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
* @author Chen
* @date 2024-05-17
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@AutoMappers({@AutoMapper(target = TeamTemplateTreeDto.class)})
@TableName("team_template_tree")
public class TeamTemplateTree implements Serializable {
    private static final long serialVersionUID = 1L;

//    @ApiModelProperty(value = "编号")
    @TableId(type= IdType.AUTO)
    private Long id;

//    @ApiModelProperty(value = "团队id")
    private Long teamId;

//    @ApiModelProperty(value = "后缀名")
    private String suffix;

//    @ApiModelProperty(value = "名称")
    private String realName;

//    @ApiModelProperty(value = "文件类型")
    private String type;

//    @ApiModelProperty(value = "储存表id")
    private String storageId;

//    @ApiModelProperty(value = "储存服务器类型")
    private String storageType;

//    @ApiModelProperty(value = "文件大小")
    private Long size;

//    @ApiModelProperty(value = "预览")
    private Integer preview;

    private String attention;

//    @ApiModelProperty(value = "下载次数")
    private Integer download;

    private String columnType;

//    @ApiModelProperty(value = "创建编号")
    @TableField(fill= FieldFill.INSERT)
    private String createId;

//    @ApiModelProperty(value = "创建日期")
    @TableField(fill= FieldFill.INSERT)
    private Date createTime;

//    @ApiModelProperty(value = "更新编号")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private String updateId;

//    @ApiModelProperty(value = "更新时间")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private Date updateTime;

//    @ApiModelProperty(value = "删除编号")
    private String deleteId;

//    @ApiModelProperty(value = "删除时间")
    private Date deleteTime;

//    @ApiModelProperty(value = "版本")
    private String editionName;

//    @ApiModelProperty(value = "描述")
    private String description;

    public void copyFrom(TeamTemplateTree source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
